package com.groupbuying.payproducer.payCenterStrategy;

import com.groupbuying.payproducer.constants.PayCenterTypeConstants;
import com.groupbuying.payproducer.utils.apiresult.ApiResult;

import java.util.Map;

/**
 * 统一支付包装实现
 *
 * @Author Vincentxin
 * @Date 2019-05-20
 */

public class PayContext {
    /**
     * 统一支付方法
     *
     * @param paramMap           参数
     * @param payCenterTypeValue 支付渠道与支付方式的拼接
     * @return
     */
    public static ApiResult unifiedPayment(Map<String, String> paramMap, String payCenterTypeValue) {
        PayStrategy payStrategy = PayStrategyFactory.getInstance().creator(payCenterTypeValue);
        return payStrategy.unifiedPayment(paramMap, PayCenterTypeConstants.getEnum(payCenterTypeValue));
    }
}
